package miejuli;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/5/25.
 */
public class buyGoods {

    public static void main(String[] arg) throws IOException, URISyntaxException, InterruptedException {
        List<String> ok=new ArrayList<>();
        List<String> wait=new ArrayList<>();
        List<String> fail=new ArrayList<>();
        String[] phones=new String[]{
                "17191784451",
                "13124922524",
                "17184852849",
                "15650422964",
                "17031444617",
                "17031497938",
                "17078850434",
                "13124986424",
                "13650378157",
                "13712161285",
                "17154350672",
                "13450035571",
                "17076320145",
                "15818338472",
                "17077260903",
                "13124988184",
                "17098324134",
                "15118256740",
                "15503234050",
                "13124965074",
                "15017886074",
                "13124995104",
                "13728444733",
                "15217502422",
                "13829594218",
                "17080806168",
                "17095938050",
                "15014855821",
                "13124958104",
                "13423369475",
                "13268482042",
                "17093094965",
                "17095936473"
        };
        for(int i=0;i<phones.length;i++){
            MeiJuLiPay buy=new MeiJuLiPay("2193131467654144","2193573147083776",phones[i]);
            buy.loginYangmao();
            int status=buy.gotoauth();
            if(status==2){
                buy.cardbinding();
//                buy.generateNewOrder();
//                buy.getOrderPay();
                ok.add(phones[i]);
            }
            if(status==1){
                wait.add(phones[i]);
            }
            if(status==0||status==3){
                fail.add(phones[i]);
            }
        }
        System.out.println("成功：");
        for(int i=0;i<ok.size();i++){
            System.out.println(ok.get(i));
        }
        System.out.println("等待：");
        for(int i=0;i<wait.size();i++){
            System.out.println(wait.get(i));
        }
        System.out.println("失败：");
        for(int i=0;i<fail.size();i++){
            System.out.println(fail.get(i));
        }
//        MeiJuLiPay buy=new MeiJuLiPay("2193131467654144","2193573147083776","13750496082");
//        buy.loginYangmao();
//        if(buy.gotoauth()==0){
//            buy.cardbinding();
//        }else{
//            System.out.println("失败");
//        }
//        buy.cardbinding();
//        buy.generateNewOrder();
//        buy.getOrderPay();
    }
}
